7-Zip Start Page

7-Zip

Welcome to 7-Zip 4.44 beta!

7-Zip is a file archiver with high compression ratio.

The documentation for 7-Zip includes:

  • General information about 7-Zip
  • User's Guide for 7-Zip File Manager
  • User's Guide for command line version

See Also

  • How to register to 7-Zip
  • Frequently Asked Questions (FAQ)

Copyright (c) 1999-2006 Igor Pavlov

Web site: www.7-zip.org

Support: www.7-zip.org/support.html

Subscribe to news: http://www.7-zip.org/subscribe.html

Forum, bugs tracking: http://sourceforge.net/projects/sevenzip/


General Information

The main features of 7-Zip

  • Powerful file manager
  • High compression ratio and high speed
  • Big number of supported archive formats
  • Additional command line version

See Also

  • How to register 7-Zip
  • License for use and distribution


Supported formats

Currently 7-Zip supports the following archive formats:
  • 7z
  • ZIP
  • GZIP
  • TAR
  • BZIP2
  • RAR (only browsing and decompression)
  • CAB (only browsing and decompression)
  • ARJ (only browsing and decompression)
  • Z (only browsing and decompression)
  • CPIO (only browsing and decompression)
  • RPM (only browsing and decompression)
  • DEB (only browsing and decompression)
  • LZH (only browsing and decompression)
  • SPLIT (only browsing and decompression)
  • CHM (only browsing and decompression)
  • ISO (only browsing and decompression)

ZIP

7-Zip creates fully ZIP compatible archives. It means that everyone can decompress these files by any ZIP compatible decompression utility. During compression 7-Zip can use one of the following ZIP compression methods:

  • 0 - Store
  • 8 - Deflate
  • 9 - Deflate64
  • 12 - BZip2

The current version of the 7-Zip can extract any files from ZIP archive that were compressed with one of the following methods:

  • 0 - Store
  • 1 - Shrink
  • 6 - Implode
  • 8 - Deflate
  • 9 - Deflate64
  • 12 - BZip2

Files compressed with other ZIP compression methods can't be extracted by the current version of the 7-Zip. But these supported methods are the most popular today, and therefore 7-Zip can decompress most ZIP archives. Forextracting files compressed with non-supported methods you must use some other ZIP utility.

7-Zip supports Zip64 extension of ZIP format.

The current version of 7-Zip doesn't support Zip multivolume archives.

LZH

7-Zip supports LZH archives only for listing, browsing and decompressing. 7-Zip supports -lh0-, -lh4-, -lh5-,-lh6- and -lh7- methods.


7z Format

7z is a new archive format, providing high compression ratio.

The main features of the 7z format:

  • Open architecture
  • High compression ratio
  • Strong AES-256 encryption
  • Ability of using any compression, conversion or encryption method
  • Supporting files with sizes up to 16000000000 GB
  • Unicode file names
  • Solid compressing
  • Archive headers compressing

7z has open architecture, so it can support any new compression methods.

Now the following methods are integrated into 7z:

Method | Description
LZMA | Improved and optimized version of LZ77 algorithm
PPMD | Dmitry Shkarin's PPMdH with small changes
BCJ | Converter for 32-bit x86 executables
BCJ2 | Converter for 32-bit x86 executables
BZip2 | Standard BWT algorithm
Deflate | Standard LZ77-based algorithm

LZMA is the default and general compression method of 7z format. The main features of the LZMA method:

  • High compression ratio
  • Variable dictionary size (up to 4 GB)
  • Compressing speed: about 1 MB/s on 2 GHz CPU
  • Decompressing speed: about 10-20 MB/s on 2 GHz CPU
  • Small memory requirements for decompressing (depend from dictionary size)
  • Small code size for decompressing: about 5 KB
  • Supporting multi-threading and P4's hyper-threading

The LZMA compression algorithm is very suitable for embedded applications. If you want to use LZMA code, you can ask for consultations, custom code programming, and required developer licenses at

www.7-zip.org/support.html

7-Zip also supports encryption with AES-256 algorithm. This algorithm uses cipher key with length of 256 bits. To create that key 7-Zip uses derivation function based on SHA-256 hash algorithm. A key derivation function produces a derived key from text password defined by user. For increasing the cost of exhaustive search for passwords 7-Zip uses big number of iterations to produce cipher key from text password.

Tips for selecting password length

We will estimate the time required for an exhaustive password search attack, when the password is a random sequence of lowercase Latin letters.

We suppose that one user can check 10 passwords per second and organization (with budget about $1 billion) can check 10 billions passwords per second. We also suppose that each 2 years processor doubles it's performance, so each additional Latin letter of long password adds about 9 years against exhaustive key search attack.

So we have such estimated time for attack:

Password Length | Single User Attack | Organization Attack
1 | 2 s | 1 s
2 | 1 min | 1 s
3 | 30 min | 1 s
4 | 12 hours | 1 s
5 | 14 days | 1 s
6 | 1 year | 1 s
7 | 10 years | 1 s
8 | 19 years | 20 s
9 | 26 years | 9 min
10 | 37 years | 4 hours
11 | 46 years | 4 days
12 | 55 years | 4 months
13 | 64 years | 4 years
14 | 73 years | 13 years
15 | 82 years | 22 years
16 | 91 years | 31 years
17 | 100 years | 40 years


Performance

ZIP Format

Compression ratio results are very dependent upon the data used for the tests. We compared 7-Zip with some of the leading commercial archivers: PKZIP 2.04g, WinZip 7.0.

FILE SET: The Canterbury Corpus (11 files totaling 2,810,784 bytes, popular file set used to compression rates).

Archiver | Compressed size | Ratio
7-Zip (zip format) | 676284 | 100%
PKZIP 2.04g -ex | 726047 | 107%
WinZip 7.0 (Max) | 731499 | 108%

7z Format

7z is the new archive format, providing high compression ratio.

FILE SET: The GIMP 1.2.4 for Windows after full installation (127 subfolders, 1304 files totaling 27,128,826 bytes). The GIMP is the GNU Image Manipulation Program. It can be downloaded from www.gimp.org.

Archiver | Compressed size | Ratio
7-Zip (7z format) | 5445402 | 100%
WinRAR 3.10 | 6004155 | 110%
WinAce 2.3 | 6242424 | 115%
CABARC 1.0 | 6455327 | 119%
7-Zip (zip format) | 9461621 | 174%
PKZIP 2.50 | 9842800 | 181%

GZIP Format

7-Zip provides best compression ratio for GZIP format. Compression ratio is equal to compression ratio provided for ZIP format.

RAR Format

7-Zip provides superior decompression speed for RAR archives. For solid archives it decompresses only files needed for decompressing. For example, there is solid archive archive.rar (containg 100000 files) that was created with command:
rar a archive.rar -s100 * -r
In that solid archive each 100 files are compressed as one big file. And if you try to extract one file from that archive, 7-Zip will decompress (in memory) only from 1 to 99 files. So you will have advantages of solid compression and big speed.


Frequently Asked Questions (FAQ)

Can I use 7-Zip in a commercial organization?

Yes, 7-Zip is free software. You can use it on any computer. You don't need to register or pay for 7-Zip.

Why command line version does not add files that do not have any extension?

You probably use *.* wildcard. 7-Zip doesn't uses system wildcard mask parser, and 7-Zip doesn't follow that archaic rule, when *.* means any file. 7-Zip treats *.* as any file that have extension. To process all files you must use * wildcard or omit wildcard at all.

Why adding, deleting and updating of existing archive doesn't work?

Current version of 7-Zip cannot change archive, created with solid option switched on. To update .7z archive you must create and update archive in non-solid mode (-ms=off switch)

What about ACE archive supporting?

Supporting ACE can be implemented, if source code of that format will be available, and if license of source code will allow using that code.


Register 7-Zip

7-Zip is a free software. However, you can support development of 7-Zip by registering and paying $20.

You can find all information about registering at:

http://www.7-zip.org/register.html

Thank you very much in advance!


Thanks

I would like to thank:

  • ARJ Software - for ARJ format.
  • Wei Dai - for SHA-256 code and Crypto++ Library
  • Jeff Gilchrist - for compressing tests
  • Brian Gladman - for AES code
  • Szymon Grabowski - for some ideas
  • Microsoft Corporation - for CAB format description, and WiX (Windows Installer XML)
  • myspace - for porting to Unix/Linux, testing, bug fixing and more
  • Nullsoft, Inc. and NSIS team - for NSIS (Nullsoft Scriptable Install System)
  • Robert Martinez - 7-Zip Logo
  • Markus Oberhumer and Laszlo Molnar - for UPX program
  • Alexander Ratushnyak - for compressing tests
  • Eugene Roshal - for RAR format
  • Matthew Russotto - for CHM/CAB format description
  • Julian Seward - for BZip2 format
  • Eugene Shelwien - for some ideas and algorithms
  • Dmitry Shkarin - for PPMd algorithm
  • Yoshioka Tsuneo - for TAR32 program
  • Vadim Yoockin - for compressing tests
  • Bulat Ziganshin - for some ideas

Localization team:

  • Afrikaans - Petri Jooste
  • Albanian - MIkel Hasko
  • Arabic - Mohammad Deeb, Awadh A Al-Ghaamdi
  • Armenian - Gevorg Papikyan
  • Asturian - Dinamiteru
  • Azeri - F@rhad
  • Basque - Inigo Salvador Azurmendi
  • Belarusian - Kirill Gulyakevitch, Drive DRKA
  • Breton - KAD-Korvigellou An Drouizig
  • Bulgarian - Chavv, icobgr
  • Catalan - Josep Casals, Gaizka Boleko, Marc Folch
  • Chinese Simplified - Modern Tiger, kaZek, Hutu Li, Junior.Spirit
  • Chinese Traditional - Leon Tseng, sec2
  • Croatian - Alan Simek
  • Czech - Jaromir Veber, Milan Hruby, Michal Molhanec
  • Danish - Jakob Schmidt, Kian Andersen
  • Dutch - Bert van Velsen, Jeroen van der Weijde, Harm Hilvers
  • Esperanto - Dmitri Gabinski
  • Estonian - Kaupo Suviste
  • Extremaduran - Miguel Angel
  • Farsi - Edris Naderan, Mehdi Farhadi
  • Finnish - Ari Ryynanen, Jarko P., Juhani Valtasalmi
  • French - Nicolas Sierro, Philippe Berthault
  • Friulian - Andrea Decorte
  • Frisian - Berend Ytsma
  • Galician - Xose Calvo
  • Georgian - Dimitri Gogelia
  • German - Soeren Finster, JAK-Software, Joachim Henke
  • Greek - Vasileios Karakoidas, Jacaranda Bill
  • Hebrew - Gal Brill, Jonathan Lahav
  • Hungarian - Jozsef Tamas Herczeg
  • Ido - iZoom
  • Indonesian - M. Rofiq Setiawan
  • Italian - Leandro Spagnol
  • Japanese - Mick
  • Korean - bzImage, ZannyLim
  • Kurdish - Rizyoye Xerzi
  • Latvian - Armands Radzushka
  • Lithuanian - Marius Navickas
  • Macedonian - Gabriel Stojanoski
  • Malay - Khairul Ridhwan Omar
  • Marathi - Subodh Gaikwad
  • Mongolian - Bayar
  • Norwegian - Christoffer Andersen
  • Polish - Cienislaw, Pixel, F1xat
  • Portuguese Brazil - Francisco Jr, Fabricio Biazzotto
  • Portuguese Standard - Carlos Macao, Joao Alves, Rui Costa
  • Romanian - Lucian Nan
  • Serbo-Croatian - Miodrag Jevremovicc
  • Slovak - Tomas Tomasek
  • Slovenian - Jernej Simoncic, miles
  • Spanish - Pablo Rodriguez, Jbc25, Guillermo Gabrielli
  • Swedish - Andreas Nilsson and Christoffer Enqvist
  • Tamil - Ve Elanjelian
  • Tatarish - Albert Fazli
  • Thai - Chayanon Ruamcharoen
  • Turkish -
  • Ukrainian - Andrij Ilechko, Mokiy Mazaylo, Sergiy Gontaruk
  • Uzbek - Sherzod Mamatkulov
  • Valencian - Tomas Miralles, Fernando Verdu
  • Vietnamese - Tran Hong Ha, Le Vu Hoang
  • Voro - Valdis Laan


7-Zip File Manager

7-Zip File Manager is a program for manipulating files and folders.

7-Zip File Manager works with two panels. You can switch between panels by pressing Tab button. The most of operations with items can be executed using keyboard shortcuts or by right-clicking on items and selecting appropriate command from menu.

In This Section

Menu Items and Shortcut Keys
Describes the menu items and keyboard shortcut.
Options Dialog Box
Describes what settings you can change that affect the 7-Zip File Manager.
Benchmark
Describes 7-Zip Benchmark for measuring CPU performance.
About Dialog Box
Provides information about 7-Zip.
Plugins
Describes plugins for 7-Zip File Manager.


Menu Items and Shortcut Keys

Menu Items

File

Menu item | Shortcut | Description
System |  | Submenu with menu commands from system shell
Open | Enter | Open current item
Open Inside | Ctrl+PgDn | Open current item as folder inside 7-Zip
Open Outside | Shift+Enter | Open current item in new window
Edit | F4 | Open selected item with editor
Rename | F2 | Rename selected item
Copy To... | F5 | Copy selected items
Move To... | F6 | Move selected items
Delete | Delete | Delete selected items
Split file... |  | Split file to parts
Combine files... |  | Combine files to one file
Comment | Ctrl+Z | Set comment for file
Calculate checksum |  | Calculates CRC checksum for files
Create Folder | F7 | Create new folder
Create File | Shift+F4 | Creates new file
Exit | Alt+F4 | Closes the program.

Edit

Menu Item | Shortcut | Description
Select All | Shift+[Grey +] | Select all items
Deselect All | Shift+[Grey -] | Select all items
Invert Selection | [Grey *] | Select / Deselect all items
Select... | [Grey +] | Select specified items
Deselect... | [Grey -] | Deselect specified items
Select by Type | Alt+[Grey +] | Select all items with the same extension as current item
Deselect by Type | Alt+[Grey -] | Deselect all items with the same extension as current item

View

Menu Item | Shortcut | Description
Large Icons | Ctrl+1 | Displays items by using large icons
Small Icons | Ctrl+2 | Displays items by using small icons
List | Ctrl+3 | Displays items in a list
Details | Ctrl+4 | Displays items in a list with detailed information about each item
Name | Ctrl+F3 | Sort items by Name
Type | Ctrl+F4 | Sort items by Type
Date | Ctrl+F5 | Sort items by Date
Size | Ctrl+F6 | Sort items by Size
Unsorted | Ctrl+F7 | Do not sort items
Flat View |  | Switch Flat view mode for list of files
2 Panels | F9 | Switch On/Off second panel
Toolbars |  | Menu items for toolbars handling
Open Root Folder | \ | Open root computer folder
Up One Level | Backspace | Open the folder one level up
Folders History... | Alt+F12 | Open folders history
Refresh | Ctrl+R | Refresh items list

Options

Menu Item | Shortcut | Description
Options... |  | Open Options dialog box

Favorites

Menu Item | Shortcut | Description
Add folder to Favorites as |  | Adds folder to favorities

Help

Menu Item | Shortcut | Description
Contents... | F1 | Opens 7-Zip Help
About 7-Zip... |  | Opens About dialog box

Miscellaneous commands

Shortcut | Description
Tab | Switch between panels
Insert | Select / Deselect current item
Shift+F10 | Display the shortcut menu for the selected items
RightCtrl+0 Alt+0 ... RightCtrl+9 Alt+9 | Open folder bookmark
Shift+RightCtrl+0 Shift+Alt+0 ... Shift+RightCtrl+9 Shift+Alt+9 | Creates folder bookmark
Alt+F1 | Edit the Folder Address on left panel
Alt+F2 | Edit the Folder Address on right panel
Ctrl+[Grey +] | Adjust optimal column width for items
Alt+Up | Open same folder in other panel
Alt+Left, Alt+Right | Open current folder in other panel

Keyboard Shortcuts

Key | Normal | Ctrl | Alt | Shift
Tab | Switch panel |  |  |
F1 | Help |  | Left Path |
F2 | Rename |  | Right Path |
F3 | View | Sort by Name |  |
F4 | Edit | Sort by Type | Exit | Create File
F5 | Copy | Sort by Date |  |
F6 | Move | Sort by Size |  |
F7 | Create Folder | Unsorted |  |
F9 | 1/2 Panels |  |  |
F10 | Menu |  |  | Shortcut Menu
F12 |  |  | Folders History |
0-9 |  | R: Folder Bookmark | Folder Bookmark |
A |  | Select All |  |
N |  | Create File |  |
R |  | Refresh |  |
Z |  | Comment |  |
Backspace | Up One Level |  |  |
Enter | Open |  | Properties | Open outside
Insert | Select Item |  |  |
Delete | Delete Item |  |  |
Page Down |  | Open Inside |  |
Page Up |  | Up One Level |  |
Up |  |  | Open same folder |
Left |  |  | Open current folder |
Right |  |  | Open current folder |
\ | Open root |  |  |
Grey / | Open root |  |  |
Grey * | Select All |  |  |
Grey + | Select | Adjust columns | Select by Type | Select All
Grey - | Deselect |  | Deselect by Type | Deselect All


Options Dialog Box

You can change many of the settings that affect the 7-Zip File Manager in the Options dialog box. To access this dialog box select Options from the Tools menu.

Options dialog box contains the following pages:

  • System Page
  • Plugins Page
  • Editor Page
  • Settings Page
  • Language Page

System Page

Allows you to specify behavior of 7-Zip in System.

Associate 7-Zip with
Lists the file name extensions and associated plugins that are currently registered with 7-Zip. If file name extension is checked, 7-Zip will be used to open file with that extension. In any case you can always open all archives with 7-Zip via context menu.

Plugins Page

Allows you to specify settings for installed plugins.

Plugins
Lists the plugins. For modifying settings of plugin you must select plugin and press Options button.

Editor Page

Allows you to specify settings for editor.

Editor
Specifies the path to editor.

Settings Page

Allows you to specify some settings.

Show .. item
Shows .. item in file list.
Show real file icons
Shows real file icons in file list. If this option is enabled, listing update can be slower.
Show system menu
Shows system context sub-menu in File menu.
Full row select
When an item is selected, the item and all its subitems are highlighted.
Show grid lines
Displays gridlines around items and subitems.
Alternative selection mode
If enabled, File Manager keeps selection mark when you move cursor.
Use large memory pages
If enabled, 7-Zip will try to use large pages. This feature allows to increase speed of compressing. But 7-Zip can make some pause at starting of compressing for allocating large pages. Also Task Manager doesn't show real memory usage of program, if 7-Zip uses large pages. This feature works only on Windows 2003 / XP x64 / Vista. Also you must have administrator's rights for your system. Recommended size of RAM: 1 GB or more. To install this feature you must run 7-Zip File Manager at least once, close it and reboot system.

Language Page

Allows you to change the default language.

Language
Lists the available languages.


Benchmark

In that box you can measure value of the performance of your computer.

There are two tests:

  1. Compressing with LZMA method
  2. Decompressing with LZMA method

Benchmark shows rating in MIPS (million instructions per second). Rating value is calculated from measured speed and it is normalized with AMD Athlon 64 X2 3800+ (2 GHz, 512 KB L2) CPU in 64-bit Windows XP with multi-threading option switched off. So if you have Athlon 64, rating values must be close to real CPU frequency.

Compressing speed and rating strongly depend from memory (RAM) latency. Also you can change dictionary size to increase memory usage. If you enable Multi-threading option, 7-Zip will use two threads for compressing. It can speed up compressing speed up to 50-80% on Multi-Processor systems or up to 25% on Pentium 4 with Hyper-Threading. Decompressing program always uses one thread, so Multi-threading option doesn't affect decompressing speed and rating.

Decompressing speed and rating strongly depend from integer part of CPU. For example, Intel Pentium 4 has big branch misprediction penalty (which is effect of long pipeline) and pretty slow multiply and shift operations. So Pentium 4 has pretty low decompressing ratings.

Total rating is average of the compressing and decompression ratings.

Also the program checks possible errors. So if Errors field shows more than 0 errors, it means that your hardware is bad. In most cases it means that your RAM is working with errors. In that case please don't use 7-Zip for compressing data, since such errors can lead to data losses.


About Dialog Box

The About dialog box provides information about 7-Zip and allows you to register 7-Zip. This dialog box is available from the Help menu.

  • Press www.7-zip.org button for opening 7-Zip Home Page.
  • Press Register button to register 7-Zip.
See also Register 7-Zip for more details how to register 7-Zip.


Plugins

7-Zip File Manager can use internal and external plugins.

Currently 7-Zip uses the following plugins:

7-Zip
Plugin for manipulating archives.


7-Zip Plugin

7-Zip is a plugin for manipulating archives. It makes all archive files look like usual folders in File Manager.

The most of operations with compressed files can be called using right-clicking on files in File Manager (or in Windows Explorer) and selecting appropriate command from menu.

Using 7-Zip

Opening archive

There are two ways to open archive file:

  • If you have appropriate file type associated with 7-Zip, then you can open file with 7-Zip by double-clicking the file or by right-clicking and selecting Open command.
  • You can right-click the archive file, point to 7-Zip, and then click the Open command item.
Extracting archive

There are two ways to extract files from archive:

  • To extract all files from archive right-click the archive file, point to 7-Zip, and then click the Extract files... command item.
  • To extract specified files from archive Open archive with 7-Zip, select items to extract and call Copy To... command.

Extract Dialog will appear.

Testing archive

To test archive right-click the archive file, point to 7-Zip, and then click the Test archive command item.

Creating and updating files archive

For creating or updating archive file right-click the file(s) or folder(s) you want to compress, point to 7-Zip, and then click the Add to archive... command item. Add to Archive Dialog will appear.


Add to Archive Dialog Box

Allows you to specify options for process of creating or updating archive.

How to call this dialog box

  1. In Windows Explorer or in 7-Zip, right-click the file(s) or folder(s) you want to compress.
  2. Point to 7-Zip, and then click the Add to archive... command item.

Parameters

Archive
Provides a space for you to specify a destination archive name. You can click "..." button to display "Open" dialog box that you can use to locate archive.
Archive format
Specifies a format of created archive. Some formats (gzip and bzip2) do not support compressing more the one file per archive.
Compression level

Specifies compression level. There are 6 levels of compression:

Value | Meaning
Store | Files will be copied to archive without compression.
Fastest | Fastest compression.
Fast | Fast compression.
Normal | Compression with balanced settings.
Maximum | It can give more compression ratio than Normal level. But it can be slower and it can require more memory.
Ultra | It can give more compression ratio than Maximum level. But it can be slower and it can require more memory.
Compression method

Specifies compression method. Each archive format can have its own compression methods:

Method | Description
LZMA | Default compression method of 7z format. It provides high compression ratio and very fast decompression.
PPMd | Dmitry Shkarin's PPMdH algorithm with small changes. Usually it provides high compression ratio and high speed for text files.
BZip2 | Standard compression method based on BWT algorithm. Usually it provides high speed and pretty good compression ratio for text files.
Deflate | Standard compression method of ZIP and GZip formats. Compression ratio is not too high. But it provides pretty fast compressing and decompressing. Deflate method supports only 32 KB dictionary.
Deflate64 | Modified version of Deflate algorithm with bigger dictionary (64KB).

Estimated 7-Zip performance and memory requirements for AMD Athlon 64 X2 3800+:

Method | Level | Dictionary Size | Compressing Speed | Decompressing Speed | Memory for Compressing | Memory for Decompressing
LZMA | fastest | 64 KB | 4.5 MB/s | 15 MB/s | 3 MB | 3 MB
fast | 1 MB | 3 MB/s | 10 MB | 3 MB
normal | 4 MB | 2.2 MB/s | 54 MB | 6 MB
maximum | 16 MB | 1.8 MB/s | 192 MB | 18 MB
ultra | 64 MB | 1.6 MB/s | 709 MB | 66 MB
PPMD | fast | 4 MB | 1.4 MB/s | 6 MB
normal | 24MB | 1.2 MB/s | 26 MB
maximum | 64 MB | 1.0 MB/s | 66 MB
ultra | 192 MB | 0.9 MB/s | 194 MB
Deflate | normal | 32 KB | 3.5 MB/s | 40 MB/s | 3 MB | 2 MB
maximum | 1.5 MB/s | 4MB
ultra | 0.4 MB/s
BZip2 | normal | 900 KB | 3 MB/s | 16 MB/s | 20 MB | 7 MB
maximum | 1.2 MB/s
ultra | 0.4 MB/s
Dictionary size

Specifies Dictionary size for compression method.

Usually higher Dictionary size gives more compression ratio. But compressing can be slower and it can require more memory.

Memory (RAM) usage for LZMA compressing is about 11 times more than dictionary size. Memory usage for LZMA decompressing is close to value of dictionary size. Memory usage for PPMd compressing and decompressing is almost equal to dictionary size.

Word size

Specifies the length of words, which will be used to find identical sequences of bytes for compression.

Usually for LZMA and Deflate big Word size gives a little bit better compression ratio and slower compression process. Big Word size parameter can significantly increase compression ratio in case when files contain long identical sequences of bytes. For PPMd Word size has big meaning. It strongly affects both compression ratio and compression/decompression speed.

Create Solid archive

Enables or disables solid mode. In solid mode all files will be compressed as one continuous data stream. Usually compressing to solid archive improves compression ratio. You can use this option only for 7z archives. With current version of 7z you can update existing archives only when solid mode is switched off. Updating solid archives also is not supported in current version.

Multi-threading

Enables or disables Multi-threading compression mode. In Multi-threading mode, 7-Zip will use two threads for compressing. It can speed up compressing speed up to 50-80% on Multi-Processor systems or up to 30% on Pentium 4 with Hyper-Threading.

Split to volumes
    {Size}[b | k | m | g]

Specifies volumes sizes in Bytes, Kilobytes (1 Kilobyte = 1024 bytes), Megabytes (1 Megabyte = 1024 Kilobytes) or Gigabytes (1 Gigabyte = 1024 Megabytes). if you specify only {Size}, 7-zip will treat it as bytes. It's possible to specify several values. Example:

    10k 15k 2m

First volume will be 10 KB, second will be 15 KB, and all others will be 2 MB.

Parameters

Provides a space for you to specify parameters for compressing. Look to -m (Method) switch description for more details. You mustn't specify -m prefix (as in -m switch) in this dialog box.

Examples

      0=PPMd

uses PPMd method for compressing files.

      0=bcj2 1=lzma:d23 2=lzma 3=lzma b0:1 b0s1:2 b0s2:3

uses BCJ2 filter (for x86 executables) and LZMA.

Update mode

Specifies update mode:

Value | Meaning
Add and replace files | Add all specified files to the archive.
Update and add files | Update older files in the archive and add files that are new to the archive.
Freshen existing files | Update specified files in the archive that are older than the selected disk files.
Synchronize files | Replace specified files only if added files are newer. Always add those files, which are not present in the archive. Delete from archive those files, which are not present on the disk.
Options

Specifies compression options:

Option | Meaning
Create SFX archive | Creates self-extracting archive. You can use this option only for 7z archives. Look to -sfx (Create SFX archive) switch description for more details about SFX modules.
Encryption

Specifies password and encryption options.

Enter password
Specify passord here
Reenter password
Reenter passord here for verification
Show Password
Shows Password
Encryption method
Specifies encryption method. For 7z format it can be only AES-256. For ZIP format you can select ZipCrypto or AES-256. Use ZipCrypto, if you want to get archive compatible with most of the ZIP archivers. AES-256 provides stronger encryption, but now AES-256 is supported only by 7-Zip, WinZip and some other ZIP archivers.
Encrypt file names
Enables or disables archive header encryption, including file names encryption.


Extract Dialog Box

Allows you to specify options for process of extracting files from archive.

How to call this dialog box

There are two ways to call this dialog

  • To extract all files from archive:
    1. In Windows Explorer or in 7-Zip, right-click the archive file.
    2. Point to 7-Zip, and then click Extract files....
  • To extract specified files from browsing window:
    1. Open archive with 7-Zip.
    2. Select items to extract.
    3. Right-click items and then click Copy To....

Parameters

Extract to
Provides a space for you to specify an output folder. You can click "..." button to display "Browse for folder" dialog box that you can use to locate output folder.
Path mode

Specify extract mode:

Value | Meaning
Full pathnames | Extract files with full pathnames.
Current pathnames | Extract files with all relative paths.
No pathnmes | Extract files without folder paths.
Overwrite mode

Specify overwrite mode for files that already present on disk:

Value | Meaning
Ask before overwrite | Ask before overwriting existing files.
Overwrite without prompt | Overwrite existing files without prompt.
Skip existing files | Skip extracting of existing files.
Auto rename | Rename extracting files, if file with such name already exists. For example, file document.txt will be renamed to document_1.txt.
Files

Specifies files for extracting:

Value | Meaning
Selected files | Extract only files that are selected in the main window.
All files | Extract all files.
Password

Specifies password for encrypted archives.


7-Zip Options Dialog Box

You can change many of the settings that affect the 7-Zip Plugin in the 7-Zip Options Dialog Box. To access this dialog box select Options from the Tools menu, select Plugins Page, select 7-Zip plugin, press Options button.

Options dialog box contains the following pages:

  • System Page
  • Folders Page

System Page

Allows you to specify behavior of 7-Zip in Windows Shell.

Integrate 7-Zip to shell context menu
Select this check box to add 7-Zip commands to Shell Context Menu.
Cascaded context menu
Select this check box to group 7-Zip context menu items to one 7-Zip submenu.
Context menu items
Lists the optional context menu items. If item is checked, 7-Zip will add this item to context menu.

Folders Page

Allows you to set folders which 7-Zip will use for internal purposes.

Working folder

Working folder section allows you to specify folder that will be used for temporary archive files:

System temp folder
7-Zip will use Windows temp folder.
Current
7-Zip will use folder containing target archive.
Specified
7-Zip will use folder specified in the following edit control.
Use for removable drives only
Specifies whether 7-Zip should use specified folder settings only for removable drives, for other drives 7-Zip will create temporary archives in the folder containing target archive. If you clear this check box, 7-Zip will use specified folder settings mode always.

7-Zip uses temporary archive files for all update operations. So for speed reasons it is recommended that you select System temp folder option and select Use for removable drives only check box.


Command Line Version User's Guide

7z.exe is command line versions of 7-Zip. 7z.exe uses other modules from 7-Zip package.

7za.exe is a standalone version of 7-Zip. 7za.exe supports only 7z, cab, zip, gzip, bzip2, Z and tar formats. 7za.exe doesn't use other modules.

  • Command Line syntax
  • Exit Codes
  • Commands
  • Switches


Command Line Syntax

7z <command> [<switch>...] <base_archive_name> [<arguments>...]

<arguments> ::= <switch> | <wildcard> | <filename> | <list_file>
<switch>::= <switch_symbol><switch_characters>[<option>]
<switch_symbol> ::= '/' | '-'
<list_file> ::= @{filename}

Expressions in square brackets (between '[' and ']') are optional.

Expressions in curly braces ('{' and '}') means that instead that Expression (including braces) must be used some string.

Expression

expression1 | expression2 | ... | expressionN

means that any (but only one) from these expressions must be specified.

Commands and switches can be entered in upper or lower case.

Command is the first non-switch argument.

The "base_archive_name" must be the first filename on the command line after the command.

The switches and other filenames can be in any order.

Wildcards or filenames with spaces must be quoted:

    "Dir\Program files\*"
    Dir\"Program files"\*

Switch options can be combined to save command line length. However, some switch options take optional string arguments and therefore, must be the last option in a combined argument token string because 7-Zip accepts the rest of the argument token as the optional argument.

7-Zip uses wild name matching similar to Windows 95:

  • '*' means a sequence of arbitrary characters.
  • '?' means any character.

7-Zip doesn't uses system wildcard mask parser, and 7-Zip doesn't follow that archaic rule, when *.* means any file. 7-Zip treats *.* as any file that have extension. To process all files you must use * wildcard.

Examples:

*.txt | means all files with an extension of ".txt"
?a* | means all files with a second character of "a"
*1* | means all names that contains character "1"
*.*.* | means all names that contain two "." means characters

The default wildcard "*" will be used if there is no filename/wildcard in command line.

Slash ('\') at the end of path means directory. Without Slash ('\') at the end of path it can refer to both file and directory.

List file

You can supply one or more filenames or wildcards for special list files (files containing lists of files). The filenames in such list file must be separated new line symbol(s).

For list files 7-Zip uses UTF-8 encoding by default. You can change encoding using -scs switch.

Multiple list files are supported.

For example, if contents of file "listfile.txt" is the following:

    My programs\*.cpp
    Src\*.cpp

then command

    7z a -tzip archive.zip @listfile.txt

adds to archive "archive.zip" all "*.cpp" files from directories "My programs" and "Src".

Short and Long File Names

7-Zip supports short file names (like FILENA~1.TXT) in some cases. But it's strongly recommended to use real (long) file names.


Exit Codes from 7-Zip

7-Zip returns the following exit codes:

Code | Meaning
0 | No error
1 | Warning (Non fatal error(s)). For example, some files were locked by other application during compressing. So they were not compressed.
2 | Fatal error
7 | Command line error
8 | Not enough memory for operation
255 | User stopped the process


Command Line Commands

Command is the first non-switch argument in command line.

Command names are not case sensitive.

See also Command Line Syntax for more details about using command line.

Commands quick reference

Command | Description
a | Add
d | Delete
e | Extract
l | List
t | Test
u | Update
x | eXtract with full paths


a (Add) command

Adds files to archive.

Examples

7z a -tzip archive.zip subdir\

adds all files and subfolders from folder subdir to archive archive.zip.

7z a -t7zip Files.7z *.txt -r

adds all *.txt files from current folder and its subfolders to archive Files.7z.

Switches that can be used with this command

-i (Include)
-m (Method)
-p (Set Password)
-r (Recurse)
-sfx (create SFX)
-si (use StdIn)
-so (use StdOut)
-t (Type of archive)
-u (Update)
-v (Volumes)
-w (Working Dir)
-x (Exclude)

See also

Commands: d (Delete), u (Update)
Switches: -u (Update)


d (Delete) command

Deletes files from archive.

Example

7z d archive.zip *.bak -r

deletes *.bak files from archive archive.zip.

Switches that can be used with this command

-i (Include)
-m (Method)
-p (Set Password)
-r (Recurse)
-u (Update)
-w (Working Dir)
-x (Exclude)

See also

Commands: a (Add), u (Update)

Switches: -u (Update)


e (Extract) command

Extracts files from archive to the current directory or to the output directory. Output directory can be specified by -o (Set Output Directory) switch.

This command places all extracted files to one directory. If you want extract files with full paths, you must use x (Extract with full paths) command.

7-Zip will prompt the user before overwriting existing files unless the user specifies the -y (Assume Yes on all queries) switch. If the user gives a no answer, 7-Zip will prompt must file be extracted to other filename. Then a no answer skips file and yes prompts for new filename.

7-Zip accepts the following responses:

Answer | Abbr. | Action
Yes | y |
No | n |
Always | a | Assume YES for ALL subsequent queries of the same class
Skip | s | Assume NO for ALL subsequent queries of the same class
Quit | q | Quit the program

Abbreviated responses are allowed.

Examples

7z e archive.zip

extracts all files from archive archive.zip to the current directory.

7z e archive.zip -oc:\soft *.cpp -r

extracts all *.cpp files from archive archive.zip to c:\soft folder.

Switches that can be used with this command

-ai (Include archives)
-an (Disable parsing of archive_name)
-ao (Overwrite mode)
-ax (Exclude archives)
-i (Include)
-o (Set Output Directory)
-p (Set Password)
-r (Recurse)
-so (use StdOut)
-x (Exclude)
-y (Assume Yes on all queries)

See also

Commands: x (Extract with full paths)


l (List contents of archive) command

Lists contents of archive.

Examples

7z l archive.zip

lists all files from archive archive.zip.

Switches that can be used with this command

-ai (Include archives)
-an (Disable parsing of archive_name)
-ax (Exclude archives)
-i (Include)
-slt (Show technical information)
-p (Set Password)
-r (Recurse)
-x (Exclude)


t (Test integrity of archive) command

Tests archive files.

Example

7z t archive.zip *.doc -r

tests *.doc files in archive archive.zip.

Switches that can be used with this command

-ai (Include archives)
-an (Disable parsing of archive_name)
-ax (Exclude archives)
-i (Include)
-p (Set Password)
-r (Recurse)
-x (Exclude)


u (Update) command

Update older files in the archive and add files that are new to the archive.

Note: Current version of 7-Zip cannot change archive, created with solid option switched on. To update .7z archive you must create and update archive in non-solid mode (-ms=off switch).

Example

7z u archive.zip *.doc

updates *.doc files to archive archive.zip.

Switches that can be used with this command

-i (Include)
-m (Method)
-p (Set Password)
-r (Recurse)
-sfx (create SFX)
-si (use StdIn)
-so (use StdOut)
-t (Type of archive)
-u (Update)
-w (Working Dir)
-x (Exclude)

See also

Commands: a (Add), d (Delete),

Switches: -u (Update)


x (Extract with full paths) command

Extracts files from archive to their full paths in the current directory or to the output directory if specified.

See e (Extract) command description for more deatails.

Examples

7z x archive.zip

extracts all files from archive archive.zip to the current directory.

7z x archive.zip -oc:\soft *.cpp -r

extracts all *.cpp files from archive archive.zip to c:\soft folder.

Switches that can be used with this command

-ai (Include archives)
-an (Disable parsing of archive_name)
-ao (Overwrite mode)
-ax (Exclude archives)
-i (Include)
-o (Set Output Directory)
-p (Set Password)
-r (Recurse)
-so (use StdOut)
-x (Exclude)
-y (Assume Yes on all queries)

See also

Commands: e (Extract)


Command Line Switches

Syntax

<switch>::= <switch_symbol><switch_characters>[<option>]
<switch_symbol> ::= '/' | '-'

On the command line, a switch consists of a switch specifier, either a dash (-) or a forward slash (/), followed by the name of the switch. Switch names cannot be abbreviated.

Some switches take an argument, specified after switch name. No spaces or tabs are allowed within a switch specification. Switch names are not case sensitive, but arguments can be case sensitive.

Switch can be used in any place in command line.

See also Command Line Syntax for more details about using command line.

Switches quick reference

Switch | Description
-- | Stop switches parsing
-ai | Include archive filenames
-an | Disable parsing of archive_name
-ao | Overwrite mode
-ax | Exclude archive filenames
-i | Include filenames
-m | Set Compression Method
-o | Set Output directory
-p | Set Password
-r | Recurse subdirectories
-scs | Set charset for list files
-seml | Send archive by email
-slp | Set Large Pages mode
-slt | Show technical information
-sfx | Create SFX archive
-si | Read data from StdIn
-so | Write data to StdOut
-t | Type of archive
-u | Update options
-v | Create Volumes
-w | Set Working directory
-x | Exclude filenames
-y | Assume Yes on all queries


-- (Stop switches parsing) switch

Disables parsing switches after "--" from command line. It will allow to use file names that start from "-".

Syntax

--

Examples

7z t -- -ArchiveName.7z

tests -ArchiveName.7z archive.


-ai (Include archive filenames) switch

Specifies additional include archive filenames and wildcards.

Multiple include switches are supported.

Syntax

-ai[<recurse_type>]<file_ref>

<recurse_type> ::= r[- | 0]
<file_ref> ::= @{listfile} | !{wildcard}

Parameters

<recurse_type>

Specifies how wildcards and file names specified in this switch must be used. If this option is not assigned, recursion will be not used. For more details see specification of the -r (Recurse) switch.

<recurse_type> ::= r[- | 0]
<file_ref>

Specifies filenames and wildcards or list file that specify processed files.

<file_ref> ::= @{listfile} | !{wildcard}
Option | Description
{listfile} | Specifies name of list file. See List file description.
{wildcard} | Specifies wildcard or filename.

Examples

7z t -an -air!*.7z

tests *.7z archives in current directory and all it's subdirectories.

Commands that can be used with this switch

a (Add), d (Delete), e (Extract), l (List), t (Test), u (Update), x (Extract with full paths)

See also

Switches: -ax (Exclude archives) -an (Disable parsing of archive_name)


-an (Disable parsing of archive_name) switch

Disables parsing archive_name field from command line. This switch must be used with -ai (Include archives) switch. If you use file list for archives, you can specify it in -ai switch, so you need to disable parsing of archive_name field from command line.

Syntax

-an

Examples

7z t -an -ai!*.7z -ax!a*.7z

tests all *.7z archives, except a*.7z archives.

Commands that can be used with this switch

e (Extract), l (List), t (Test), x (Extract with full paths)

See also

Switches: -ai (Include archives) -ax (Exclude archives)


-ao (Overwrite mode) switch

Specifies overwrite mode during extracting for files that already present on disk.

Syntax

-ao[a | s | t | u ]

Switch | Description
-aoa | Overwrite All existing files without prompt.
-aos | Skip extracting of existing files.
-aou | aUto rename extracting file (for example, name.txt will be renamed to name_1.txt).
-aot | auto rename existing file (for example, name.txt will be renamed to name_1.txt).

Examples

7z x test.zip -aoa

extracts all files from test.zip archive and overwrite existing files without prompt.

Commands that can be used with this switch

e (Extract), x (Extract with full paths)

See also

Switches: -y (assume Yes on all queries),


-ax (Exclude archive filenames) switch

Specifies what archives must be excluded from operation.

Multiple exclude archive switches are supported.

Syntax

-ax[<recurse_type>]<file_ref>

<recurse_type> ::= r[- | 0]
<file_ref> ::= @{listfile} | !{wildcard}

See -xi (Include archive filenames) switch description for information about option parameters.

Examples

7z t -an -ai!*.7z -ax!a*.7z

tests all *.7z archives, except a*.7z archives.

Commands that can be used with this switch

e (Extract), l (List), t (Test), x (Extract with full paths)

See also

Switches: -ai (Include archives) -an (Disable parsing of archive_name)


-i (Include filenames) switch

Specifies additional include filenames and wildcards.

Multiple include switches are supported.

Syntax

-i[<recurse_type>]<file_ref>

<recurse_type> ::= r[- | 0]
<file_ref> ::= @{listfile} | !{wildcard}

Parameters

<recurse_type>

Specifies how wildcards and file names specified in this switch must be used. If this option is not assigned then global value, assigned by -r (Recurse) switch will be used. For more details see specification of the -r (Recurse) switch.

<recurse_type> ::= r[- | 0]
<file_ref>

Specifies filenames and wildcards or list file that specify processed files.

<file_ref> ::= @{listfile} | !{wildcard}
Option | Description
{listfile} | Specifies name of list file. See List file description.
{wildcard} | Specifies wildcard or filename.

Examples

7z a -tzip src.zip *.txt -ir!DIR1\*.cpp

adds to src.zip archive all *.txt files from current directory and all *.cpp files from directory DIR1 and from all it's subdirectories.

Commands that can be used with this switch

a (Add), d (Delete), e (Extract), l (List), t (Test), u (Update), x (Extract with full paths)

See also

Switches: -r (Recurse), -x (Exclude)


-m (Set compression Method) switch

Specifies compression method.

Syntax

-m<method_parameters>

Format of this switch is depended from archive type.

Zip

Parameter | Default | Description
x=[0 | 1 | 3 | 5 | 7 | 9 ] | 5 | Sets level of compression.
m={MethodID} | Deflate | Sets a method: Copy, Deflate, Deflate64, BZip2.
fb={NumFastBytes} | 32 | Sets number of Fast Bytes for Deflate encoder.
pass={NumPasses} | 1 | Sets number of Passes for Deflate encoder.
d={Size}[b|k|m] | 900000 | Sets Dictionary size for BZip2
mt=[off | on | {N}] | on | Sets multithreading mode.
em={EncryptionMethodID} | ZipCrypto | Sets a encryption method: ZipCrypto, AES128, AES192, AES256
x=[0 | 1 | 3 | 5 | 7 | 9 ]

Sets level of compression. x=0 means Copy mode (no compression).

Deflate / Deflate64 settings:

Level | NumFastBytes | NumPasses | Description
1 | 32 | 1 | Fastest
3 | Fast
5 | Normal
7 | 64 | 3 | Maximum
9 | 128 | 10 | Ultra

BZip2 settings:

Level | Dictionary | NumPasses | Description
1 | 100000 | 1 | Fastest
3 | 500000 | Fast
5 | 900000 | Normal
7 | 2 | Maximum
9 | 7 | Ultra
fb={NumFastBytes}

Sets number of fast bytes for Deflate/Deflate64 encoder. It can be in range from 3 to 258 (257 for Deflate64). Usually big number gives a little bit better compression ratio and slower compression process. Big number of fast bytes parameter can significantly increase compression ratio in case when files contain long identical sequences of bytes.

pass={NumPasses}

Sets number of passes for Deflate encoder. It can be in range from 1 to 15 for Deflate and from 1 to 10 for BZip2. Usually big number gives a little bit better compression ratio and slower compression process.

d={Size}[b|k|m]

Sets Dictionary size for BZip2. You must specify size in bytes, kilobytes, or megabytes. The maximum value for dictionary size is 900000b. If you do not specify any symbol from set [b|k|m], dictionary size will be calculated as DictionarySize = 2^Size bytes.

mt=[off | on | {N}]

Sets multithread mode. If you have multiprocessor system or Pentium 4 with hyperthreading, you can get speed increasing with this switch. This option affects only compressing with BZip2, Deflate and Deflate64 methods and decompressing of BZip2 streams. Each thread in multithread mode uses 32 MB of RAM for buffering. If you specify {N}, 7-Zip tries to use N threads.

GZip

GZip uses the same parameters as Zip, but GZip compresses only with Deflate method.

BZip2

Parameter | Default | Description
x=[1 | 3 | 5 | 7 | 9 ] | 5 | Sets level of compression.
pass={NumPasses} | 1 | Sets number of Passes for Bzip2 encoder.
mt=[off | on | {N}] | on | Sets multithreading mode.
x=[1 | 3 | 5 | 7 | 9 ]

Sets level of compression

Level | NumPasses | Description
5 | 1 | Default compression method.
7 | 2 | Maximum compression method.
9 | 7 | Ultra compression method.
pass={NumPasses}

Sets number of passes. It can be in range from 1 to 10. Default value is 1 for normal mode, 2 for maximum mode and 7 for ultra mode. Bigger number can give a little bit better compression ratio and slower compression process.

mt=[off | on | {N}]

Sets multithread mode. If you have multiprocessor system or Pentium 4 with hyperthreading, you can get speed increasing with this switch. If you specify {N}, for example mt=4, 7-Zip tries to use 4 threads.

7z

Parameter | Default | Description
x=[0 | 1 | 3 | 5 | 7 | 9 ] | 5 | Sets level of compression.
s=[off | on | [e] [{N}f] [{N}b | {N}k | {N}m | {N}g] | on | Sets solid mode.
f=[off | on] | on | Enables or disables compression filters for executable files.
hc=[off | on] | on | Enables or disables archive header compressing.
hcf=[off | on] | on | Enables or disables full archive header compressing.
he=[off | on] | off | Enables or disables archive header encryption.
b{C1}[s{S1}]:{C2}[s{S2}] |  | Sets binding beetwen coders.
{N}={MethodID}[:param1][:param2][..] | LZMA | Sets a method: LZMA, PPMd, BZip2, Deflate, BCJ, BCJ2, Copy.
mt=[off | on | {N}] | on | Sets multithreading mode.
x=[0 | 1 | 5 | 7 | 9 ]

Sets level of compression

Level | Method | Dictionary | FastBytes | MatchFinder | Filter | Description
0 | Copy | No compression.
1 | LZMA | 64 KB | 32 | HC4 | BCJ | Fastest compressing
3 | LZMA | 1 MB | 32 | HC4 | BCJ | Fast compressing
5 | LZMA | 4 MB | 32 | BT4 | BCJ | Normal compressing
7 | LZMA | 16 MB | 64 | BT4 | BCJ | Maximum compressing
9 | LZMA | 64 MB | 64 | BT4 | BCJ2 | Ultra compressing
s=[off | on | [e] [{N}f] [{N}b | {N}k | {N}m | {N}g)]

Enables or disables solid mode. The default mode is s=on. In solid mode files are grouped together. Usually compressing in solid mode improves compression ratio.

e | Use separate solid block for each new file extension
{N}f | Set limit for number of files in one solid block
{N}b | {N}k | {N}m | {N}g | Set limit for total size of solid block in bytes

By default there is limitation for solid block size:

Compression Level | Solid block size
Store | 0 B
Fastest | 16 MB
Fast | 128 MB
Normal | 512 MB
Maximum | 2 GB
Ultra | 8 GB

Limitation for solid block size usually decreases compression ratio but gives the following advantages:

  • Decreases losses in case of future archive's damaging.
  • Decreases extracting time of the group of files (it can be one file), if this group doesn't contain all files of archive.

Current version of 7-Zip doesn't support updating for solid archives, if it requires repacking solid blocks.

Example:

        s=100f10m

set solid mode with 100 files & 10 MB limits per one solid block.

f=[off | on]

Enables or disables compression filters for executable files: dll, exe, ocx, sfx, sys. It uses BCJ2 filter in Ultra mode and BCJ filter in other modes. The default mode is f=on.

hc=[off | on]

Enables or disables archive header compressing. The default mode is hc=on. If archive header compressing is enabled, some parts of archive header will be compressed with LZMA method.

hcf=[off | on]

Enables or disables full archive header compressing. The default mode is hcf=on. Archives created with hcf=on can be extracted by 7-Zip 2.30 beta 25 and more.

he=[off | on]

Enables or disables archive header encryption. The default mode is he=off.

{N}

Sets order of methods. It is used also to associate parameters with methods. Numbers must begin from 0. Method that have minor number will be used before others.

b{C1}[s{S1}]:{C2}[s{S2}]

Binds output stream S1 in coder C1 with input stream S2 in coder C2. If stream number is not specified, stream with number 0 will be used.

Usally coder has one input stream and one output stream. In 7z some coders can have multiple input and output streams.

For example, BCJ2 encoder has one input stream and four output streams.

mt=[off | on | {N}]

Sets multithread mode. If you have multiprocessor system or Pentium 4 with hyperthreading, you can get speed increasing with this switch. 7-Zip supports multithread mode only for LZMA compressing and BZip2 compressing / decompressing. If you specify {N}, for example mt=4, 7-Zip tries to use 4 threads. LZMA compressing uses only 2 threads.

{N}={MethodID}[:param1][:param2] ... [:paramN]

Sets compression method. You can use any number of methods. The default method is LZMA.

Parameters must be in one of the following forms:

  • {ParamName}={ParamValue}.
  • {ParamName}{ParamValue}, if {ParamValue} is number and {ParamName} doesn't contain numbers.

Supported methods:

MethodID | Description
LZMA | Algorithm based on LZ algorithm
PPMd | Dmitry Shkarin's PPMdH with small changes
BZip2 | BWT algorithm
Deflate | LZ+Huffman
Copy | No compression

Supported filters:

MethodID | Description
BCJ | converter for x86 executables
BCJ2 | converter for x86 executables (version 2)
BC_ARM | converter for ARM (little endian) executables
BC_ARMThumb | converter for ARM Thumb (little endian) executables
BC_IA64 | converter for IA-64 executables
BC_PPC_B | converter for PowerPC (big endian) executables
BC_SPARC | converter for SPARC executables

Filters allow to increase compression ratio for some types of files. Filters must be used with one of the compression method (for example, BCJ + LZMA).

LZMA

LZMA is an algorithm based on Lempel-Ziv algorithm. It provides very fast decompressing (about 10-20 times faster than compressing). Memory requirements for compressing and decompressing also are different (see d={Size}[b|k|m] switch for details).

Parameter | Default | Description
a=[0|1] | 1 | Sets compressing mode
d={Size}[b|k|m] | 22 | Sets Dictionary size
mf={MF_ID} | bt4 | Sets Match Finder
fb={N} | 32 | Sets number of Fast Bytes
mc={N} | 32 | Sets Number of Cycles for Match Finder
lc={N} | 3 | Sets number of Literal Context bits - [0, 8]
lp={N} | 0 | Sets number of Literal Pos bits - [0, 4]
pb={N} | 2 | Set number of Pos Bits - [0, 4]
a=[0|1]

Sets compressing mode: 0 = fast, 1 = normal. Default value is 1.

d={Size}[b|k|m]

Sets Dictionary size for LZMA. You must specify size in bytes, kilobytes, or megabytes. The maximum value for dictionary size is 1 GB = 2^30 bytes. Default value for LZMA is 22 (4 MB) in normal mode, 24 (16 MB) in maiximum mode (-mx=7) and 26 (64 MB) in ultra mode (-mx=9). If you do not specify any symbol from set [b|k|m], dictionary size will be calculated as DictionarySize = 2^Size bytes. For decompressing file compressed by LZMA method with dictionary size N you need about N bytes of memory (RAM) available.

mf={MF_ID}

Sets Match Finder for LZMA. Default method is bt4. Algorithms from hc* group doesn't provide good compression ratio, but they often works pretty fast in combination with fast mode (a=0). Memory requirements depend from dictionary size (parameter "d" in table below).

MF_ID | Memory | Description
bt2 | d*9.5 + 4 MB | Binary Tree with 2 bytes hashing.
bt3 | d*11.5 + 4 MB | Binary Tree with 3 bytes hashing.
bt4 | d*11.5 + 4 MB | Binary Tree with 4 bytes hashing.
hc4 | d*7.5 + 4 MB | Hash Chain with 4 bytes hashing.

Note: Operation system also needs some amount of physical memory for system's purposes. So keep at least 32MB of physical memory unused.

fb={N}

Sets number of fast bytes for LZMA. It can be in range from 5 to 273. Default value is 32 for normal mode and 64 for maximum and ultra modes. Usually big number gives a little bit better compression ratio and slower compression process.

mc={N}

Sets number of cycles (passes) for match finder. It can be in range from 0 to 1000000000. Default value is (16 + number_of_fast_bytes / 2) for BT* match finders and (8 + number_of_fast_bytes / 4) for HC4 match finder. If you specify mc=0, LZMA will use default value. Usually big number gives a little bit better compression ratio and slower compression process. For example, mf=HC4 and mc=10000 can provide almost same compression ratio as mf=BT4.

lc={N}

Sets number of literal context bits (high bits of previous literal). It can be in range from 0 to 8. Default value is 3. Sometimes lc=4 gives gain for big files.

lp={N}

Sets number of literal pos bits (low bits of current position for literals). It can be in range from 0 to 4. Default value is 0. lp switch is intended for periodical data when period is equal 2^value (where lp=value). For example, for 32-bit (4 bytes) periodical data you can use lp=2. Often it's better to set lc=0, if you change lp switch.

pb={N}

Sets number of pos bits (low bits of current position). It can be in range from 0 to 4. Default value is 2. pb switch is intended for periodical data when period is equal 2^value (where lp=value).

PPMd

PPMd is a PPM-based algorithm. This algorithm is mostly based on Dmitry Shkarin's PPMdH sources. PPMd provides very good compression ratio for plain text files. There is no difference between compressing speed and decompressing speed. Memory requirements for compressing and decompressing also are the same.

Parameter | Default | Description
mem={Size}[b|k|m] | 24 | Sets size of used memory for PPMd.
o={Size} | 6 | Sets model order for PPMd.
mem={Size}[b|k|m]

Sets size of used memory for PPMd. You must specify size in bytes, kilobytes, or megabytes. The maximum value is 2GB = 2^31 bytes. Default value is 24 (16MB). If you do not specify any symbol from set [b|k|m], memory size will be calculated as (2^Size) bytes. PPMd uses the same amount of memory for compressing and decompressing.

o={Size}

Sets model order for PPMd. Size must be in range [2,32]. Default value is 6.

BCJ2

BCJ2 is Branch converter for 32-bit x86 executables (version 2). It converts some branch instructions for increasing further compression.

BCJ2 encoder has one input stream and four output streams:

  • s0: main stream. It requires further compression.
  • s1: stream for converted CALL values. It requires further compression.
  • s2: stream for converted JUMP values. It requires further compression.
  • s3: service stream. It is already compressed.

If LZMA is used, size of dictionary for streams s1 and s2 can be much smaller (512 KB is enough for most cases) than dictionary size for stream s0.

Examples

7z a -tzip archive.zip *.jpg -mx0

adds *.jpg files to archive.zip archive without compression.

7z a -t7z archive.7z *.exe *.dll -m0=BCJ -m1=LZMA:d=21 -ms -mmt

adds *.exe and *.dll files to solid archive archive.7z using LZMA method with 2 MB dictionary and BCJ converter. Compressing will use multithreading optimization.

7z a -t7z archive.7z *.exe *.dll -m0=BCJ2 -m1=LZMA:d23 -m2=LZMA:d19 -m3=LZMA:d19
     -mb0:1 -mb0s1:2 -mb0s2:3

adds *.exe and *.dll files to archive archive.7z using BCJ2 converter, LZMA with 8 MB dictionary for main output stream (s0), and LZMA with 512 KB dictionary for s1 and s2 output streams of BCJ2.

7z a -t7z archive.7z *.txt -m0=PPMd

adds *.txt files to archive archive.7z using PPMd method.

Commands that can be used with this switch

a (Add), d (Delete), u (Update),

See also

Switches: -t (set Type of archive),


-o (set Output directory) switch

Specifies destination directory where files are to be extracted.

This switch can be used only with extraction commands.

Syntax

-o{dir_path}
{dir_path}
Specifies the destination directory path. It's not required that a path ends with a backslash.

Example

7z x archive.zip -oc:\Doc

extracts all files from archive.zip archive to c:\Doc directory.

Commands that can be used with this switch

e (Extract), x (Extract with full paths)


-p (set Password) switch

Specifies password.

Syntax

-p{password}
{password}
Specifies password.

Examples

7z a archive.7z -psecret -mhe *.txt

compresses *.txt files to archive.7z using password "secret". Also it encrypts archive headers (-mhe switch), so filenames will be encrypted.

7z x archive.zip -psecret

extracts all files from archive.zip using password "secret".

Commands that can be used with this switch

a (Add), d (Delete), e (Extract), t (Test), u (Update), x (Extract with full paths)


-r (Recurse subdirectories) switch

Specifies method of treating wildcards and filenames assigned in command line.

Syntax

-r[- | 0]

Switch | Description
-r | Enable recurse subdirectories.
-r- | Disable recurse subdirectories. This option is default for all commands.
-r0 | Enable recurse subdirectories only for wildcard names.

Examples

7z l archive.zip *.doc -r-

lists all *.doc files that belong root archive directory in archive.zip archive.

7z a -tzip archive.zip -r src\*.cpp src\*.h

adds all *.cpp and *.h files from directory src and all it's subdirectories to archive.zip archive.

Commands that can be used with this switch

a (Add), d (Delete), e (Extract), l (List), t (Test), u (Update), x (Extract with full paths)

See also

Switches: -i (Include), -x (Exclude)


-scs (Set charset for list files) switch

Sets charset for list files.

Syntax

-scs{UTF-8 | WIN | DOS}

Default charset is UTF-8.

UTF-8
Unicode UTF-8 character set.
WIN
Default character set of Windows.
DOS
Default DOS (OEM) character set of Windows.

Example

7z a archive.7z @listfile.txt -scsWIN

compresses files from listfile.txt list, that contains list of files in default character set of Windows.

Commands that can be used with this switch

a (Add), u (Update)


-seml (Send archive by email) switch

Sends archive by e-mail.

Syntax

-seml[.]
[.]
Archive will be deleted after attaching to email message.

Example

7z a archive.7z -seml a.txt

compresses a.txt file and sends using archive.7z by email.

Commands that can be used with this switch

a (Add), u (Update)


-sfx (Create SFX archive) switch

Creates self extracting archive.

Syntax

-sfx[{SFX_Module}]
{SFX_Module}

Specifies the SFX module that will be added to archive. This module must be placed in the same directory as the 7z.exe. If {SFX_Module} is not assigned, 7-Zip will use standard console SFX module 7zCon.sfx.

SFX_Module | Description
7z.sfx | Windows version.
7zCon.sfx | Console version.
7zS.sfx | Windows version for installers.
7zSD.sfx | Windows version for installers (uses MSVCRT.dll).

All SFX modules are uncompressed. You can use UPX program (http://upx.sourceforge.net) to compresss such modules. After compressing by UPX program size of sfx module will be reduced to 40-50% of original size.

SFX modules for installers

SFX modules for installers are included in external package (7z_extra). You can download these modules from www.7-zip.org. SFX modules for installers (7zS.sfx and 7zSD.sfx) allow to create installation program. Such module extracts archive to temp folder and then runs specified program and removes temp files after program finishing. Self-extract archive for installers must be created as joining 3 files: SFX_Module, Installer_Config, 7z_Archive. Installer_Config is optional file. You can use the following command to create installer self-extract archive:

copy /b 7zS.sfx + config.txt + archive.7z archive.exe

The smallest installation package size can be achivied, if installation files was uncompressed before including to 7z archive.

-y switch for installer module specifies quiet mode for extracting.

Installer Config file format

Config file contains commands for Installer. File begins from string ;!@Install@!UTF-8! and ends with ;!@InstallEnd@!. File must be written in UTF-8 encoding. File contains string pairs:

ID_String="Value"

ID_String | Description
Title | Title for messages
BeginPrompt | Begin Prompt message
Progress | Value can be "yes" or "no". Default value is "yes".
RunProgram | Command for executing. Default value is "setup.exe". Substring %%T will be replaced with path to temporary folder, where files were extracted
Directory | Directory prefix for "RunProgram". Default value is ".\\"
ExecuteFile | Name of file for executing
ExecuteParameters | Parameters for "ExecuteFile"

You can omit any values.

There are two ways to run program: RunProgram and ExecuteFile. Use RunProgram, if you want to run some program from .7z archive. Use ExecuteFile, if you want to open some document from .7z archive or if you want to execute some command from Windows.

If you use RunProgram and if you specify empty directory prefix: Directory="", the system searches for the executable file in the following sequence:

  1. The directory from which the application (installer) loaded.
  2. The temporary folder, where files were extracted.
  3. The Windows system directory.

Config file Examples

;!@Install@!UTF-8!
Title="7-Zip 4.00"
BeginPrompt="Do you want to install the 7-Zip 4.00?"
RunProgram="setup.exe"
;!@InstallEnd@!

;!@Install@!UTF-8!
Title="7-Zip 4.00"
BeginPrompt="Do you want to install the 7-Zip 4.00?"
ExecuteFile="7zip.msi"
;!@InstallEnd@!

;!@Install@!UTF-8!
Title="7-Zip 4.01 Update"
BeginPrompt="Do you want to install the 7-Zip 4.01 Update?"
ExecuteFile="msiexec.exe"
ExecuteParameters="/i 7zip.msi REINSTALL=ALL REINSTALLMODE=vomus"
;!@InstallEnd@!

Examples

7z a -sfx a.exe *.txt

adds *.txt files to self extracting archive a.exe using the default console SFX module.

7z a -sfx7z.sfx a.exe *

adds all files to self extracting archive a.exe with module 7z.sfx using windows version of SFX mudule.

Commands that can be used with this switch

a (Add), d (Delete), u (Update),


-si (read data from stdin) switch

Makes 7-Zip to use data from stdin (standard input).

Syntax

-si{file_name}
{file_name}
Specifies a name that will be stored in archive for compressed data. If file_name is not specified, data will be stored without name.

Note: Current version of 7-Zip doesn't support reading archives from stdin.

Example

7z a archive.gz -tgzip -siDoc2.txt < Doc.txt

compresses input stream from file Doc.txt to archive.gz archive using Doc2.txt file name.

Commands that can be used with this switch

a (Add), u (Update)


-so (write data to stdout) switch

Makes 7-Zip to use stdout (standard output stream).

Syntax

-so

Examples

7z x archive.gz -so > Doc.txt

decompresses archive.gz archive to output stream and writes that stream to Doc.txt file.

7z a dummy -tgzip -so Doc.txt > archive.gz

compresses Doc.txt file to output stream and writes that stream to archive.gz file.

Commands that can be used with this switch

a (Add), e (Extract), u (Update), x (Extract with full paths)


-slp (Set Large Pages mode) switch

Sets Large Pages mode.

Syntax

-slp[-]

Switch | Description
-slp | Enables Large Pages mode.
-slp- | Disables Large Pages mode. This option is default for all commands.

Large Pages mode allows to increase speed of compressing. But 7-Zip can make some pause at starting of compressing for allocating large pages. Also Task Manager doesn't show real memory usage of program, if 7-Zip uses large pages. This feature works only on Windows 2003 / XP x64 / Vista. Also you must have administrator's rights for your system. Recommended size of RAM: 1 GB or more. To install this feature you must run 7-Zip File Manager at least once, close it and reboot system.

Example

7z a archive.7z -slp a.iso

compresses a.iso file with Large Pages mode switched on.


-slt (Show technical information) switch

Sets technical mode for l (List) command.

Syntax

-slt

Example

7z l -slt archive.7z

shows technical information for archive.7z.

Commands that can be used with this switch

l (List)


-o (set Output directory) switch

-t (set Type of archive) switch

Specifies the type of archive.

Syntax

-t{archive_type}
{archive_type}
Specifies the type of archive. It can be: 7z, zip, gzip, bzip2 or tar. 7z format is default.

Note: gzip or bzip2 formats support only one file per archive. So if you need to compress more than one file to these formats, create tar archive before and then compress it with selected format.

Example

7z a -tzip archive.zip *.txt

adds all *.txt files from current directory to zip archive archive.zip.

Commands that can be used with this switch

a (Add), u (Update)


-u (Update options) switch

Specifies how to update files in archive and (or) how to create new archives.

Syntax

-u[-]<action_set>[!{new_archive_name}]

  <action_set> ::= <state_action>...

    <state_action> ::= <state><action>

      <state> ::= p | q | r | x | y | z | w

      <action> ::= 0 | 1 | 2 | 3

Parameters

dash (-)

Disables any updates in base archive.

Term base archive means archive assigned by "base_archive_name" string in command line. See Command line syntax for more details.

{new_archive_name}

Specifies path of the new archive, which must be created. All options in this switch will refer to this new archive.

If not assigned, then all options in this switch will refer to base archive of command.

<state>

Specifies state for particular processed file.

<state> ::= p | q | r | x | y | z | w

For each unique filename there are 6 variants of state:

<state> | State condition | File on Disk | File in Archive
p | File exists in archive, but is not matched with wildcard. | Exists, but is not matched
q | File exists in archive, but doesn't exist on disk. | Doesn't exist | Exists
r | File doesn't exist in archive, but exists on disk. | Exists | Doesn't exist
x | File in archive is newer than the file on disk. | Older | Newer
y | File in archive is older than the file on disk. | Newer | Older
z | File in archive is same as the file on disk | Same | Same
w Can not be detected what file is newer (times are the same, sizes are different) ? ?
<action>

Specifies action for appropriate <state>.

<action> ::= 0 | 1 | 2 | 3

For each state you can specify one of the three variants of actions:

<action> | Description
0 | Ignore file (don't create item in new archive for this file)
1 | Copy file (copy from old archive to new)
2 | Compress (compress file from disk to new archive)
3 | Create Anti-item (item that will delete file or directory during extracting). This feature is supported only in 7z format.

Remarks

Any update command (such as a (Add), d (Delete), u (Update)) can be assigned in these terms.

The following table shows action sets for update commands.

command \ <state> | p | q | r | x | y | z | w
d (Delete) | 1 | 0 | 0 | 0 | 0 | 0 | 0
a (Add) | 1 | 1 | 2 | 2 | 2 | 2 | 2
u (Update) | 1 | 1 | 2 | 1 | 2 | 1 | 2
Synchronize | 1 | 0 | 2 | 1 | 2 | 1 | 2

If you don't specify !{new_archive_name} option, then all options will refer to main archive (archive assigned in command line after command). If you specify !{new_archive_name} option, then 7-Zip also will create a new archive with specified name and all options will refer to that new archive.

Multiple update switches are supported. 7-Zip can create any number of new archives during one operation.

By default, action set for each new archive is assigned as action set of main command. There are 3 different action sets for commands: a (Add), d (Delete), u (Update). You can overload any <state_action> pair.

Examples

7z u c:\1\exist.7z -u- -up0q3x2z0!c:\1\update.7z *

creates new archive update.7z and writes to this archive all files from current directory that differs from files in exist.7z archive. exist.7z archive will not be changed.

7z u c:\1\exist.7z -up0q3x2z0!c:\1\update.7z * -ms=off

creates new archive update.7z and writes to this archive all files from current directory that differs from files in exist.7z archive.

Note: Current version of 7-Zip cannot change archive, created with solid option switched on. To update .7z archive you must create and update archive in non-solid mode (-ms=off switch).

Commands that can be used with this switch

a (Add), d (Delete), u (Update),


-v (Create Volumes) switch

Specifies volumes sizes.

Syntax

-v{Size}[b | k | m | g]
{Size}[b | k | m | g]
Specifies volumes size in Bytes, Kilobytes (1 Kilobyte = 1024 bytes), Megabytes (1 Megabyte = 1024 Kilobytes) or Gigabytes (1 Gigabyte = 1024 Megabytes). if you specify only {Size}, 7-zip will treat it as bytes.

It's possible to specify several -v switches.

NOTE: Please don't use volumes (and don't copy volumes) before finishing of archiving. 7-Zip can change any volumes (including first volumes) at the end of archiving.

Examples

7z a a.7z *.txt -v10k -v15k -v2m

creates multivolume a.7z archive. First volume will be 10 KB, second will be 15 KB, and all others will be 2 MB.

Commands that can be used with this switch

a (Add),


-w (set Working directory) switch

Sets working directory for temporary base archive. By default, 7-Zip builds a new base archive file in the same directory as the old base archive file. By specifying this switch, you can set the working directory where the temporary base archive file will be built. After the temporary base archive file is built, it is copied over the original archive and then temporary file is deleted.

Syntax

-w[{dir_path}]
{dir_path}

Specifies the destination directory path. It's not required that a path ends with a backslash.

If <dir_path> is not assigned, then 7-Zip will use Windows temporary directory.

Example

7z a -tzip archive.zip *.cpp -wc:\temp

adds *.cpp files to archive.zip archive creeating temporary archive in c:\temp folder.

Commands that can be used with this switch

a (Add), d (Delete), u (Update),


-x (Exclude filenames) switch

Specifies what filenames or (and) wildcards must be excluded from operation.

Multiple exclude switches are supported.

Syntax

-x[<recurse_type>]<file_ref>

<recurse_type> ::= r[- | 0]
<file_ref> ::= @{listfile} | !{wildcard}

See -i (Include) switch description for information about option parameters.

Examples

7z a -tzip archive.zip *.txt -x!temp.*

adds to archive archive.zip all *.txt files, except temp.* files.

Commands that can be used with this switch

a (Add), d (Delete), e (Extract), l (List), t (Test), u (Update), x (Extract with full paths)

See also

Switches: -r (Recurse), -i (Include)


-y (assume Yes on all queries) switch

Disables most of the normal user queries during 7-Zip execution. You can use this switch to suppress overwrite queries in the e (Extract) and x (Extract with full paths) commands.

Syntax

-y

Examples

7z x src.zip -y

extracts all files from src.zip archive. All overwrite queries will be suppressed and files on disk with same filenames as in archive will be overwritten.

Commands that can be used with this switch

e (Extract), x (Extract with full paths)

See also

Switches: -ao (Overwrite mode),


License for use and distribution

License

7-Zip Copyright (C) 1999-2007 Igor Pavlov.

Licenses for files are:

  • Rar29.dll: GNU LGPL + unRAR restriction
  • AES.dll and 7za.exe: GNU LGPL + AES code license
  • All other files: GNU LGPL

    Read file License.txt for full information about license.